package com.bestcem.xm.ticket.dao;

import com.bestcem.xm.ticket.entity.mongo.TicketRule;

import javax.annotation.Nonnull;
import java.util.List;

/**
 * 工单规则dao
 *
 * @author jy.zhao
 * @version 1.0
 * @date 2021/8/17 19:59
 **/
public interface TicketRuleDao {

    /**
     * 根据id查询 TicketRule
     *
     * @param id TicketRuleId
     * @return Ticket
     * @author jy.zhao
     * @date 2021/8/17 20:00
     **/
    TicketRule findById(String id);

    /**
     * 根据ticketConfigId查询 TicketRule
     *
     * @param ticketConfigId
     * @return java.util.List<com.bestcem.xm.ticket.entity.mongo.TicketRule>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2021/9/28 13:45
     */
    List<TicketRule> listByTicketConfigId(String ticketConfigId);

    /**
     * 根据ids查询工单规则列表
     *
     * @param ids
     * @param ticketConfigId
     * @return List<TicketRule>
     * @version v1.0
     * @author gy.liu
     * @date 2021/8/18
     */
    List<TicketRule> listByIds(List<String> ids, String ticketConfigId);

    /**
     * 保存工单规则
     *
     * @param ticketRule
     * @return TicketRule
     * @version v1.0
     * @author gy.liu
     * @date 2021/8/18
     */
    TicketRule saveTicketRule(TicketRule ticketRule);

    /**
     * 修改ticketRule
     *
     * @param ticketRule
     * @author liheng
     * @date 2021/8/25 21:17
     */
    String updateTicketRule(String id, TicketRule ticketRule);

    /**
     * 修改ticketRule
     *
     * @param id        工单规则id
     * @param condition 工单规则 condition
     * @author XiaoYunSong <ys.xiao@idiaoyan.com>
     * @date 2021/9/16 17:59
     */
    boolean updateTicketRuleCondition(@Nonnull String id, @Nonnull TicketRule.Condition condition);
}
